package compilador.gerador.comando;
import compilador.Command;
import compilador.CommandException;
import compilador.gerador.GeradorDeCodigo;


public class CodeAppendCommand implements Command {

	private static final String SELF = "self";
	private static final String DIFERENTE = "<>";
	private static final String EQUALS = "=";

	@Override
	public void run(String... args) throws CommandException {
		String code = args[0];
		if ( code.equals(SELF)) {
			code = "this";
		} if (code.equals(DIFERENTE) ) {
			code = "!=";
		}  if (code.equals(EQUALS) ) {
			code = "==";
		}
		GeradorDeCodigo.getInstance().appendCode(code);
	}

}
